/**
 * @description 云豆名称
 */
import React from 'react';
import { Tag } from '@teamix/ui';
import TextAvatar from '@txdfe/at-text-avatar';
import './index.scss';
import intl from '../../locale';

export default class YundouName extends React.PureComponent {
  render() {
    const { hasAvatar } = this.props;
    if (hasAvatar) {
      return (
        <>
          <TextAvatar
            image={'https://img.alicdn.com/tfs/TB1WYSpIQL0gK0jSZFtXXXQCXXa-400-401.png'}
            text={intl.get({
              id: 'code-assets.components.yundouName.KidneyBeans',
              defaultMessage: '云豆',
            })}
            needAddedText
            size="xs"
          />

          <span className="log-item-title-author-tag">
            <Tag>bot</Tag>
          </span>
        </>
      );
    } else {
      return (
        <span className="yundou-name-inline">
          {intl.get({
            id: 'code-assets.components.yundouName.KidneyBeans',
            defaultMessage: '云豆',
          })}

          <span className="log-item-title-author-tag">
            <Tag>bot</Tag>
          </span>
        </span>
      );
    }
  }
}
